package com.fhz.lifeandvm;

import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;

/**
 * 时间:2023/8/15
 *
 * @author Mr.Feng
 * 简述: TODO
 */
public class MainViewModel extends ViewModel {

    MutableLiveData<String> list =  new MutableLiveData<>();
    MutableLiveData<Integer> number =  new MutableLiveData<>();

    public MainViewModel(int i) {
        number.setValue(i);
    }

    private int num = 1;

    public void add(){
//        num += 1;
        number.setValue(number.getValue()+1);
    }

    public int getNum() {
        return num;
    }

    public void test(){
        list.setValue("123");
    }


}
